1. Technical Field
The present invention is generally directed to an improved data processing system. More specifically, the present invention is directed to a system and method for tracing the execution of a portion of computer code to allow for collection of a plurality of metrics during a single profiling run.
2. Description of Related Art
In analyzing and enhancing performance of a data processing system and the applications executing within the data processing system, it is helpful to know which software modules within a data processing system are using system resources. Effective management and enhancement of data processing systems requires knowing how and when various system resources are being used. Performance tools are used to monitor and examine a data processing system to determine resource consumption as various software applications are executing within the data processing system. For example, a performance tool may identify the most frequently executed modules and instructions in a data processing system, or may identify those modules which allocate the largest amount of memory or perform the most I/O requests. Hardware performance tools may be built into the system or added at a later point in time.
One known software performance tool is a trace tool. A trace tool may use more than one technique to provide trace information that indicates execution flows for an executing program. One technique keeps track of particular sequences of instructions by logging certain events as they occur, so-called event-based profiling technique. For example, a trace tool may log every entry into, and every exit from, a module, subroutine, method, function, or system component. Alternately, a trace tool may log the requester and the amounts of memory allocated for each memory allocation request. Typically, a time-stamped record is produced for each such event. Corresponding pairs of records similar to entry-exit records also trace execution of arbitrary code segments, starting and completing I/O or data transmission, and for many other events of interest.
In order to improve performance of code generated by various families of computers, it is often necessary to determine where time is being spent by the processor in executing code, such efforts being commonly known in the computer processing arts as locating “hot spots.” Ideally, one would like to isolate such hot spots at the instruction and/or source line of code level in order to focus attention on areas which might benefit most from improvements to the code.
Another trace technique involves periodically sampling a program's execution flows to identify certain locations in the program in which the program appears to spend large amounts of time. This technique is based on the idea of periodically interrupting the application or data processing system execution at regular intervals, so-called sample-based profiling. At each interruption, this trace technique records information for a predetermined length of time or for a predetermined number of events of interest. For example, the program counter of the currently executing thread, which is an executable portion of the larger program being profiled, may be recorded at each interval. This analysis may allow for resolving the recorded values against a load map and symbol table information for the data processing system at post-processing time and for obtaining a profile of where the time is being spent.
Typically, known performance tools are capable of monitoring and analyzing the performance of a data processing system and the applications executing within the data processing system with regard to a single metric, e.g., CPU cycles, number of instructions, etc. That is, each metric of interest requires a single run of an application or program being traced. Thus, in a first run of the program, the performance tool may measure a first metric. In order to obtain performance information for an application with regard to another metric, the application must be run again with a performance tool that is capable of monitoring the application with regard to this other metric.
When applied to simulations, monitoring performance data and tracing the execution of such simulations may take large amounts of time. In fact, some simulations may take multiple days to complete. Typically, it is desired that performance data with regard to a plurality of different metrics be obtained from such simulations. However, with known systems, such performance data collection, tracing, and post processing to produce sampled base reports or reports by subroutine roll ups can only be performed with regard to single metrics per run of the simulation. As a result, multiple runs of a simulation are necessary to obtain all of the desired reports. This greatly increases the time and expense in obtaining the reports needed for performance analysis, verification, and the like.
Thus, it would be beneficial to have a system and method for collecting a plurality of metrics in a single profiling run of a computer code.